package com.yanqu.road.server.cmd.activity.common;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.common.CommonActivityModule;
import com.yanqu.road.server.manger.activity.CommonActivityMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.server.command.Cmd;

import java.util.List;


@Cmd(code = Protocol.S_COMMON_ACTIVITY_NOTIFY_CHECK_GOODS,desc = "使用通用活动道具")
public class CommonActivityNotifyCheckGoodsCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        List<ActivityInfo> activityInfoList = CommonActivityMgr.getAllOpenCommonActivityInfoList();
        if(activityInfoList.size() > 0) {
            player.getModule(CommonActivityModule.class).autoUseActivityGoods(activityInfoList);
        }
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
